//
//  BannerWebService.m
//  YYZB
//
//  Created by 顾悦 on 16/3/24.
//
//

#import "BannerWebService.h"

@implementation BannerWebService

- (void)getBannersByImageLevel:(NSString *)imageLevel
                        pageNo:(NSString *)pageNo
                      pageSize:(NSString *)pageSize
                   CommunityId:(NSString *)CommunityId
             completionHanlder:(void (^)(NSArray *items, NSError *error))completionHanlder {
    NSString *URL = @"Service/GetBannerOrPropagandaPic";
    NSDictionary *params = @{
                             @"Id": @"",
                             @"ImageLevel": imageLevel,
                             @"ImageType": @"1",
                             @"CommunityId":CommunityId?CommunityId : @""
//                             @"PageSize": pageSize,
//                             @"PageNo": pageNo
                             };
    NSString *URLString = [self formattedURLString:params method:URL sessionNeeded:NO];
    [self sendHTTPGetRequest:URLString completionHandler:^(id result, NSError *error) {
        
        if (error != nil) {
            completionHanlder(nil, error);
        } else {
            NSError *err;
            NSArray *items = [self unboxedValue:result error:&err];
            completionHanlder(items, err);
        }
    }];
}

@end
